﻿//delay the script from running until the page is done loading and the sp.js file has been loaded
$(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(insertNavigationItems, "sp.js");
});

//iterate through the generated array of menu items to add, and add them after the "About" link
function insertNavigationItems() {
    var $nav = $("UL.ms-core-listMenu-root");
    $nav.find('li').each(function () {
        if ($(this).find('a').attr('href').toLowerCase().indexOf("person.aspx") !== -1) {
            for (var i = newNavItems.length - 1; i >= 0; i--) {
                $(newNavItems[i]).insertAfter($(this));
            }
        }
    });
}
